﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Data.Metadata.Edm;
using System.Data.SqlClient;

namespace SoftHotel.Models
{
    public class ListaPreciosDAO : DbContext
    {
        public ListaPreciosDAO(): base("conexionPrincipalDAO"){}

        public DbSet<Sede> Sedes { get; set; }
        public DbSet<DetallePrecio> DetallesPrecio { get; set; }
        public DbSet<Servicio> Servicios { get; set; }
        public DbSet<Parametro> Parametros { get; set; }
        public DbSet<Ambiente> Ambientes { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Sede>().ToTable("Sede");
            modelBuilder.Entity<DetallePrecio>().ToTable("DetallePrecio");
            modelBuilder.Entity<Servicio>().ToTable("Servicio");
            modelBuilder.Entity<Servicio>().Property(x => x.estado).HasColumnName("estado");
            modelBuilder.Entity<Parametro>().ToTable("Parametro");
            modelBuilder.Entity<Ambiente>().ToTable("Ambiente");
        }
    }
}